www-Sharp.ClrHost is an extension for Internet Explorer HTML applications. It contains some enhancments:
Historically, programming languages like C++ and Microsoft Visual Basic« have provided the object models and access to system resources thatádevelopers demand. With HTA it is now time to add Dynamic HTML (DHTML) with script to that list. HTAs not only support everything a Web page doesùnamely HTML, Cascading Style Sheets (CSS), scripting languages, and behaviorsùbut also HTA-specific functionality. This added functionality provides control over user interface design andáaccess to the client system. Moreover, run as trusted applications, HTAs are not subject to the same security constraints as Web pages. As with any executable file, the user is asked once, before the HTA is downloaded, whether to save or run the application; if savedáto the client machine, it simply runs on demand thereafter. The end result is that HTAs runs like any executable (.exe) written in C++ or Visual Basic.
HTAs are suited to many uses, whether you are prototyping, making wizards, or building full-scale applications. Whatever DHTML and script deliver nowùforms, multimedia, Web applications, HTML editors, and browsersùso can HTAs...and then some. Best of all, HTAs make some tasks easier. The simplicity of generating prototypes using HTAs makes it possible for program managers and designers to script dialog boxes and alerts while the C++ or Visual Basic developers program the underlying functionality.
HTML applications have some advantages over standard Win32 and .Net Windows Forms applications:
Use of www-Sharp.ClrHost is very easy. All you need is toáadd OBJECT element in your HTML page, set parameters with PARAM tags and use properties and methods from JScript, VBScript or other ActiveX script language. All www-Sharp.ClrHost elements except ClrControl should be added in HEAD section ù they are not visual. ClrControl should be added in BODY section as anyáother ActiveX control.
Compiled HTML applications are produced with HTA compiler ù htac.exe. Startup file is index.hta in the root application directory.
www-Sharp.ClrHost SDK contains some examples that shows basic use of its objects.
Compiled HTML application requiresáadding some registry entries. These entries could be added by executing install.reg file that could be found in Install directory of www-Sharp.ClrHost SDK.
If HTA uses .Net framework, www-Sharp.ClrHost should be installed too. It can be installed by addingáCODEBASE attribute to OBJECT tag for the first www-Sharp.ClrHost object in startup page or it can be installed by installation project. HtaClrHost.cab is located in redist directory in www-Sharp.ClrHost SDK and is avaiable at http://www-sharp.com/downloads/HtaClrHost.cab .
To install with application installator you should place HtaClrHost.dll into %SYSTEM%\www Sharp_ ClrHost\ directory and register it for COM (registration for COM will automatically register Compiled HTML application, so no other registry keys are required) . Sample installation project for popular InnoSetup installer is located in Install directory of www-Shrap.ClrHost SDK.
www-Sharp.ClrHost includes 2 manifest files: mshta.exe.manifest and hh.exe.manifest. If you will place them into %System% directory (usually C:\Windows\System or C:\WinNt\System32) all HTML applications and HTML help files willáuse XP styleácommon controls (open/save dialog boxes, trees, tab controls etc.)áon Windows XP. Those files will not affect prior Windows versions.
To see XP-style HTML pages you may include
<META http-equiv="MSThemeCompatible" content="Yes">
into HEAD section of HTML page.